var g =  function* () {
  try {
  console.log("第1次运行")
  yield 1;
  console.log("第2次运行")
  yield 2;
  console.log("第3次运行")
  } catch(error) {
    console.error('出现了错误：', error);
  }
}
const gen = g();
console.log(gen.next())
console.log(gen.next())
console.log(gen.throw(4))
console.log(gen.next())


